<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input class="a" type="text">
    <select class="sec">
     <option value="+">+</option>
     <option value="-">-</option>
     <option value="*">*</option>
     <option value="/">/</option>
    </select>
    <input class="b" type="text">
     =
     <input class="c" type="text">
     <button class="bnt">点击计算</button> 
     <script>
      var aEle = document.getElementsByClassName(`a`)[0]
      var bEle = document.getElementsByClassName(`b`)[0]
      var cEle = document.getElementsByClassName(`c`)[0]
      var butEle = document.getElementsByClassName(`bnt`)[0]
      var secEle = document.getElementsByClassName(`sec`)[0]
      butEle.onclick = function(){
          var a =parseInt(aEle.value);
          var b =parseInt(bEle.value);
          var paly = secEle.value;
        if(paly ==`+`){
           var res = a+b;
        }
        else if(paly==`-`){
           var res = a-b;
        }
        else if(paly==`*`){
            var res = a*b;
        }
        else{
            var res = a/b;
        }
        console.log(res)
          cEle.value = res 
       }

   

     </script>   
</body>
</html>